import { Body, Controller, Post } from '@nestjs/common'
import { SmsService } from './sms.service'

@Controller('sms')
export class SmsController {
  constructor(private readonly smsService: SmsService) {}

  // 前端调用此接口触发短信发送（例如：找回密码时）
  @Post('reset-password-code')
  async sendResetCode(@Body() body: { phone: string, uid?: string }) {
    return this.smsService.sendCodeByPhone(body)
  }
}
